package com.stu.service;

import com.stu.dao.IUserDao;

/**
 * 手动依赖注入userDao
 * @author zy
 * @date 2025/3/28
 */
public class UserServiceImpl implements IUserService{

    private IUserDao userDao;

    public UserServiceImpl() {
        System.out.println("调用UserServiceImpl的构造");
    }

    // setUserDao用于注入
    public void setUserDao(IUserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public int deleteById(int id) {
        userDao.deleteById(id);
        return id;
    }
}
